<template>
	<view class="content">
		<list class="coll_list">
			<cell class="coll_item" v-for="(item,index) in dataList"
			                         @tap="itemClick(item.chapterId)">
				<view class="item_left">
					<view>{{item.chapterName}}
					<text style="font-size: 26rpx; color: #777777; margin-left: 10rpx;"> 
					({{item.cousreName}})
					</text>
					</view>
					<view>收藏：{{item.count}}</view>
				</view>
				<view class="item_right">
					<button>查看</button>
				</view>
			</cell>
		</list>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataList: []
			}
		},onReady: function() {
			uni.request({
				url: this.baseUrl+'getCollectNumber', //GET /app/getCollectNumber
				method:'GET',
				data: {
					stuId: uni.getStorageSync('uid')
				},
				header: {
					'content-type': 'application/x-www-form-urlencoded' //自定义请求头信息
				},
				success: (res) => {
					 this.dataList=res.data.data;
					 console.log(res.data);
					
				},
			});
		},
		methods:{
			itemClick:function(index){
				uni.navigateTo({
					url: '../collectDetail/collectDetail?id=' + index
				});
			}
		}
	}
</script>

<style>
	.coll_list {
		background: #FFFFFF;
	}

	.coll_list .coll_item {
		display: flex;
		padding: 20rpx;
		background: #FFFFFF;
		align-items: center;
		justify-content: space-between;
		border-bottom: 1rpx solid #DADADA;
	}

	.coll_list .coll_item .item_left view:nth-child(1) {
		font-size: 30rpx;
		color: #333333;
	}

	.coll_list .coll_item .item_left view:nth-child(2) {
		font-size: 28rpx;
		color: #f64f00;
		margin-top: 24rpx;
	}

	.coll_list .coll_item .item_right button {
		width: 120rpx;
		height: 66rpx;
		font-size: 28rpx;
		color: #fe6703;
		text-align: center;
		line-height: 66rpx;
		background: #FFFFFF;
		border: 2rpx solid #fe6703;
	}
</style>
